import torch, torchvision
from torch import nn
from torch.nn import L1Loss
import torch.nn.functional as F

# 已有模型的使用

resnet18_true = torchvision.models.resnet18(pretrained=True)
resnet18_false = torchvision.models.resnet18(pretrained=False)

# 增加自定义模型
resnet18_true.fc.add_module('add_liner', nn.Linear(512, 10))
print(resnet18_true)